require 'util'
require "TSLib"
local thread = require('thread')
function fight()
    useSkill({
        {1254,797},
        {1266,620},
        {1448,552},
        {1447,373},
        {1461,231},
    },10)
end

-- 定时检测普通键判断是否需要战斗
function autoFight()
    thread.create(
        function ()
            -- touchDown(2,375,686)
            while true do
                -- 检测坐标颜色 判断是否战斗
                if isColor(1405, 745,0xd8b741) then
                    -- 战斗
                    fight()
                else
                    mSleep(2000)
                end
            end
        end
        )
end